<?
class Tags {
	var $htmlString;
	
	function renderTagsForItem($itemType,$itemID) {
		global $dbname, $db, $db_selected;
		
		if ($itemType == 'library') {
			$sql = "SELECT Tags from cdc_LibraryMediaList WHERE LibraryID = '$itemID'";
		} elseif ($itemype == 'resources') {
			
		}
		$result = mysql_db_query($dbname,$sql);
		$row = mysql_fetch_assoc($result);
		if (!empty($row['Tags'])) {
			$tagString .= '<div class="hiLite" title="Related tags"><p class="iconTag"><b>Tags for this item:</b>';
			
			$tagArray = explode(' ',$row['Tags']);
			for($a=0;$a<=(count($tagArray)-1);$a++) {
				$tag = trim($tagArray[$a]);
				$tagString .= '<a href="'.$_SERVER['PHP_SELF'].'?tag='.$tag.'">'.$tag.'</a> ';
			}
			
			$tagString .= '</p></div>';
		}
		return $tagString;	
	}	
}
?>